<script setup>
  import { computed } from 'vue'

  const emit = defineEmits(['click'])
  const props = defineProps({
    // 高
    size: [String, Number],
    // 颜色
    color: String
  })
  const onClick = (e) => {
    emit('click', e)
  }
  // 字体图标类名
  const iconStyle = computed(() => {
    return {
      'font-size': props.size + 'rpx',
      color: props.color,
      'font-weight': 600
    }
  })
</script>
<template>
  <text
    class="iconfont"
    :style="iconStyle"
    @click="onClick"
  >
    <slot></slot>
  </text>
</template>

<style lang="scss" scoped>
  .bit-icon {
    fill: currentColor;
    overflow: hidden;
  }
</style>
